﻿using System;
using System.Xml.Serialization;

namespace Kiva7.DataClasses
{
    public class ScheduledPayment
    {
        [XmlElement("amount")]
        public double Amount { get; set; }

        [XmlElement("due_date")]
        public DateTime? DueDate { get; set; }

        [XmlIgnore]
        public DateTime? DueDateOnly
        {
            get
            {
                if (DueDate.HasValue)
                    return DueDate.Value.Date;
                else
                    return null;
            }
        }

        [XmlIgnore]
        public string DueDateShort
        {
            get
            {
                if (DueDate.HasValue)
                    return DueDate.Value.ToShortDateString();
                else
                    return null;
            }
        }
    }
}
